-
Notifications
You must be signed in to change notification settings - Fork 32
Retry installing Visual Studio Build Tools on failure #177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
bkhouri
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments for your consideration.
7deb288 to
6e1cdb2
Compare
We've seen occasional failures to install the Visual Studio Build Tools due to flakey responses from the server. Attempt to make this script more robust by adding a retry with exponential backoff, attempting up to 10 times before eventually giving up. This adds the same logic to both the VSB and Swift toolchain downloads.
6e1cdb2 to
79b5dd5
Compare
| ## | ||
| ## This source file is part of the Swift.org open source project | ||
| ## | ||
| ## Copyright (c) 2024 Apple Inc. and the Swift project authors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2025
| while (-not $Success -and $Attempt -lt $MaxRetries) { | ||
| $Attempt++ | ||
| try { | ||
| Invoke-WebRequest -Uri $Uri -OutFile $OutFile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible just to do a head request or something similar?
Download could fail for other reasons like no disk space, as far as I've seen, the most common issue is network timeout from GH or something similar
We've seen occasional failures to install the Visual Studio Build Tools due to flakey responses from the server.
Attempt to make this script more robust by adding a retry with exponential backoff, attempting up to 10 times before eventually giving up. This adds the same logic to both the VSB and Swift toolchain downloads.